<template>
  <div class="background">
    <mt-popup v-model="popupVisible" position="left" class="popup">
      <drawer @isclose="close"></drawer>
    </mt-popup>
    <nav-bar class="navbar" @isopen="open"></nav-bar>
    <div class="box-calendar"><calendar class="calendar"></calendar></div>
    <div class="time" @click="gotime">专注计时</div>
    <div class="x-circle"><x-circle></x-circle></div>
    <div class="box1">
      <div class="box-item1">
        <div class="box11">
          <img src="../../assets/item-task.svg" alt="" /><br />
          <div>已完成任务</div>
          <div class="count">125</div>
        </div>
        <div class="box21">
          <img src="../../assets/item-clock.svg" alt="" />
          <div>连续打卡天数</div>
          <div class="count">21</div>
        </div>
      </div>
      <div class="box-item2">
        <div class="box12">
          <img src="../../assets/item-time.svg" alt="" /><br />
          <div>专注学习总时长</div>
          <div class="count">112h</div>
        </div>
        <div class="box22">
          <img src="../../assets/item-zhuanzhu.svg" alt="" />
          <div>被关注任务数</div>
          <div class="count">3</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import Calendar from "./home-components/Calendar.vue";
import Drawer from "./home-components/Drawer.vue";
import NavBar from "./home-components/NavBar.vue";
import XCircle from "./home-components/X-Circle.vue";

export default {
  components: { NavBar, Calendar, XCircle, Drawer },
  name: "Home",
  data() {
    return {
      popupVisible: false,
    };
  },
  methods: {
    open() {
      this.popupVisible = true;
      // console.log(this.popupVisible);
    },
    close(payload) {
      this.popupVisible = payload;
    },
    gotime() {
      this.$router.push("/gotime");
    },
  },
  // created(){
  //   this.popupVisible = eval(this.$route.query.popupVisible)
  // }
};
</script>

<style scoped>
.background {
  /* position: fixed; */
  height: 1165px;
  width: 100%;
  /* overflow-y: scroll; */
  /* overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; */
  background-color: #dddddd07 !important;
}
.navbar {
  /* position: fixed;
  width: 100%;
  height: 44px;
  left: 0;
  top: 0;
  z-index: 1000; */
  background-color: white;
  /* box-shadow: .5px .5px .5px #F5657C; */
}
.box-calendar {
  /* margin-top: 49px; */
  width: 97%;
  height: 305px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-left: 1.5%;
}
/* .calendar{
  box-shadow: .5px .5px .5px #F5657C;
  background-color: white;
} */
.time {
  width: 97%;
  height: 60px;
  line-height: 60px;
  border: 0.5px solid #f5657c;
  /* background-color: #f5657c; */
  background-image: linear-gradient(to right, #fff, #f5657c, #9198e5, #fff);
  border-radius: 20px;
  margin-left: 1.5%;
  text-align: center;
  margin-bottom: 5px;
  font-size: 18px;
  font-weight: 400;
  color: aqua;
}
.x-circle {
  width: 97%;
  height: 240px;
  margin-left: 1.5%;
  border: 0.5px solid #f5657c;
  border-radius: 20px;
  background-color: white;
  display: flex;
  justify-content: center;
  align-items: center;
}
.popup {
  width: 70%;
  height: 1165px;
  /* background-color: greenyellow; */
  background-image: linear-gradient(#f5657c, #9198e5, #fff);
  z-index: 999;
  border-radius: 0 20px 20px 0;
}
.box1,
.box2 {
  width: 97%;
  height: 445px;
  position: relative;
  float: left;
  margin-top: 5px;
  margin-left: 1.5%;
  border-radius: 20px;
  border: 0.5px solid #f5657c;
  /* display: flex; */
}
.count {
  font-size: 32px;
  font-weight: 700;
  margin-top: 25px;
}
.box-item1,
.box-item2 {
  width: 100%;
  height: 220px;
  position: relative;
  float: left;
  display: flex;
  justify-content: center;
  align-items: center;
}
.box11,
.box12 {
  width: 43%;
  height: 200px;
  /* margin-left: 3%; */
  text-align: center;
  background-color: #cccccc1e;
  border-radius: 20px;
  box-shadow: 2px 2px 3px 3px #f5657c;
  /* margin-top: 10px; */
}
.box21,
.box22 {
  width: 43%;
  height: 200px;
  margin-left: 5%;
  text-align: center;
  background-color: #cccccc1e;
  border-radius: 20px;
  box-shadow: 2px 2px 3px 3px #f5657c;
  /* margin-top: 10px; */
}
.box11 img,
.box21 img,
.box12 img,
.box22 img {
  width: 65px;
  height: 65px;
}
</style>
